package org.itboys.ace.web.lasted;

import org.itboys.admin.entity.lasted.SystemLog;
import org.itboys.admin.service.lasted.SystemLogService;
import org.itboys.framework.query.JsonPageUtils;
import org.itboys.framework.spring.controller.BaseController;
import org.itboys.param.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;

/**
 * 作者：zzq
 * 时间：2017年3月20日
 * 描述：供应链金融   系统日志controller
 */
@Controller
@RequestMapping("/ace/system/log")
public class AceSystemLogController extends BaseController {
    @Autowired
    private SystemLogService logService;
    @RequestMapping("/log-list")
    public ModelAndView paramTemplateList(HttpServletRequest request, HttpServletResponse response, Model model) {
        return new ModelAndView("/ace/sys/log/log-index");
    }
    /**
     * 分页查询日志
     * @param request
     * @param response
     */
    @RequestMapping("/select")
    public void selectDictionary(HttpServletRequest request, HttpServletResponse response){
       //  result= null;
        try {
            PageResult<SystemLog>   result = logService.selectLog(request);
            JsonPageUtils.renderJsonPage(result.getTotal(),result.getData(),response);
        } catch (ParseException e) {
            e.printStackTrace();
        }


    }
}
